/*
 * Ethan Levine
 * 
 * The contents of this file are subject to the GNU General Public
 * License (GPL) v2.  The full contents of this license can be
 * found at Mathma's website, http://www.codeplex.com/mathma/license
 */

package mathma.core.expr;

import mathma.core.real.FiniteReal;
import mathma.core.real.Real;

/**
 * @since 0.1.5
 * @author Ethan Levine
 */
public class RealConstant extends Constant<Real> {
    
    public static final Constant<Real> PI = new RealConstant("π",
            new FiniteReal(Math.PI));
    
    // Real.ONE.exp() is more accurate than Math.E
    public static final Constant<Real> E = new RealConstant("e",
            Real.ONE.exp());
    
    public RealConstant(String symbol, Real value) {
        super(symbol, value);
    }
    
    public RealConstant(String symbol, String desc, Real value) {
        super(symbol, desc, value);
    }
    
    @Override
    public Expression<Real> differentiate(Variable<Real> var) {
        // Constants CANNOT change, so they always differentiate to 0.
        return Real.ZERO;
    }
}
